#ifndef AUCTROWWIDGET_H
#define AUCTROWWIDGET_H

#include <QtSql>
#include <QtGui>

#include "ui_auctrowwidget.h"

class AuctRowWidget : public QWidget, private Ui::AuctRowWidget
{
Q_OBJECT

public:

AuctRowWidget(QMap<QString, QStringList> opened_album_attrs_);
~AuctRowWidget();

public slots:

void new_record( qint64 coin_id, QString opened_album );
void save_clicked();
QSqlRecord read_record(QSqlRecord record);
void set_record( QSqlRecord record,
                 QModelIndex index);
 
signals:

void record_to_commit(QSqlRecord record,
                      QModelIndex index,
                      QLatin1String id,
                      bool new_record);

private:

void writeSettings();
void readSettings();
QMap<QString, QStringList> opened_album_attrs;
QSqlRecord current_record;
QModelIndex current_index;
bool is_new;

protected:

void closeEvent( QCloseEvent * e );

};

#endif // AUCTROWWIDGET_H
